<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@taglib uri="/WEB-INF/page-base.tld" prefix="w"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML>
<html>
<head>
	<%@ include file="/platform/style.jsp" %>
	<style>
		.ss0 {
			color: red
		}
	</style>
	<script>
        function query() {
            $w.execForm({pageNum: 1})
        }
        function available() {
            $w.doUrl(ctx + "/floor/UiFloorPage@updatestatus.page?bean.state='AVAILABLE'", $("#queryForm").serializeArray(), function () {
                query()
            })
        }
        function unavailable() {
            $w.doUrl(ctx + "/floor/UiFloorPage@updatestatus.page?bean.state='UNAVAILABLE'", $("#queryForm").serializeArray(), function () {
                query()
            })
        }
        function removed() {
            $w.doUrl(
                ctx + "/floor/UiFloorPage@updatestatus.page?bean.state='REMOVED'",
                data, $("#queryForm").serializeArray(), function () {
                    query()
                })
        }
        function add() {
            window.parent.$w.openDialog({
                url: ctx + '/floor/UiFloorPage@updatestatus.page',
                title: "添加楼层 ",
                w: 600,
                h: 260,
                afterClose: function (re) {
                    if (re) $w.execForm();
                }
            });
        }
        function showPanel(id) {
            $w.openDialog({
                url: ctx + '/floor/UiFloorPage@showPanel.page?bean.floorid=' + id,
                title: "查看面板 ",
                w: 700,
                h: 400,
                maximized: true,
                afterClose: function (re) {
                    if ($w.listFlesh) $w.execForm();
                }
            });
        }
	</script>
</head>

<script type="application/javascript" src="${ctx}/platform/UI/js/ui.js"></script>
<script>
function addflooritem(){
	window.parent.$w.openDialog({url:ctx+'/floor/item/${panid}',title:"添加面板类目 ",w:820,h:480,afterClose:function(re){
		if(re){$w.execForm({"form":$("#flooritemForm")});$w.listFlesh=true;}
	}});
}
function editflooritem(id){
	window.parent.$w.openDialog({url:ctx+'/floor/item/${panid}/'+id,title:"编辑面板类目 ",w:865,h:480,afterClose:function(re){
		if(re){$w.execForm({"form":$("#flooritemForm")});$w.listFlesh=true;}
	}});
}
function delflooritem(id){
	window.parent.$w.confirmMsg("确定删除？", function(r){
		if(r){
		    var ids = $("tbody").find("[name='primaryKey_']:checked").map(function () {
				return $(this).val();
            }).get();
			$w.doUrl(ctx+"/floor/item",{"_method":"DELETE","ids":ids},function(json){
			})
		}
	})
}
</script>

<body class="easyui-layout">
<div data-options="region:'center'" class="bodybg">
	<!-- 查询区域 -->
	<form id="queryForm" action="/floor/UiFloorPage.page" method="post">
		<div class="easyui-panel ui-toolBar" border="false" data-options="doSize:false">
			<a href="javascript:;" class="easyui-linkbutton" plain="true" onclick="add()" style="width:50px;">添加</a>
			<a href="javascript:;" class="easyui-linkbutton" plain="true" onclick="available()"
			   style="width:50px;">展示</a>
			<a href="javascript:;" class="easyui-linkbutton" plain="true" onclick="unavailable()"
			   style="width:50px;">隐藏</a>
			<a href="javascript:;" class="easyui-linkbutton" plain="true" onclick="removed()" style="width:50px;">删除</a>

		</div>
		<div class="ui_line" style="margin-top:10px"></div>
		<!-- 数据列表区域 -->
		<table class="ui-table" width="100%" cellpadding="1" cellspacing="1" data-options="showPage:true,
																						pageNum:<w:write bind="pageNum"/>,
																						pageSize:<w:write bind="pageSize_"/>,
																						total:<w:write bind="pagination.totalCount"/>">
			<thead>
			<tr class="ui_th">
				<td width="35" align="center"><input type="checkbox" onclick="$selAllTbBoxs(this)"></td>
				<td width="50">ID</td>
				<td>类目名称</td>
				<td>创建时间</td>
				<td width="130" align="center">操作</td>
			</tr>
			</thead>
			<tbody>
			<c:forEach items="${items}" var="info">
				<tr class="ui_td">
					<td width="35" align="center"><input type="checkbox" name="primaryKey_" value="${info.id}"></td>
					<td>${info.id}</td>
					<td>${info.title}</td>
					<td>${info.create_time}</td>
					<td align="center">
						<a href="javascript:;" class="ui_btn marginR8" onclick="editflooritem(${info.id})">修改</a>
					</td>
				</tr>
			</c:forEach>
			</tbody>
		</table>
	</form>
</div>
</body>
</html>
<div class="easyui-layout" fit="true">
<div data-options="region:'center'">
	<form id="flooritemForm" action="${ctx}/floor/item" method="post">
	<!-- 操作区域 -->
	<div class="easyui-panel ui-toolBar" border="false" data-options="doSize:false">
		<a href="javascript:;" class="easyui-linkbutton" plain="true" onclick="addflooritem()" style="width:50px;">添加</a>
		<a href="javascript:;" class="easyui-linkbutton" plain="true" onclick="delflooritem()" style="width:50px;">删除</a>
	</div>
	<div class="ui_line" style="margin-top:10px"></div>
	</form>
</div>
</div>
